package com.bsoft.gol.hcs.clinical.dao;


import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import hcn.base.reviewdrug.MedicationDecoction;

import java.util.List;

public abstract class MedicationDecoctionDAO extends HibernateSupportDelegateDAO<MedicationDecoction> {

    @DAOMethod(sql = " from MedicationDecoction where decoctionStatus = 1 and hospitalCode =:hospitalCode  order by sort asc")
    public abstract List<MedicationDecoction> queryMedicationDecoction(@DAOParam("hospitalCode") String hospitalCode);


    @DAOMethod(sql = " from MedicationDecoction where decoctionStatus = 1 and hospitalCode =:hospitalCode and decoctionCode=:decoctionCode")
    public abstract List<MedicationDecoction> queryMedicationDecoctionByDecoctionCode(@DAOParam("hospitalCode") String hospitalCode, @DAOParam("decoctionCode") String decoctionCode);


    @DAOMethod(sql = " from MedicationDecoction where decoctionStatus = 1 and decoctionCode =:decoctionCode ")
    public abstract List<MedicationDecoction> queryByDecoctionCode(@DAOParam("decoctionCode")String decoctionCode);

    @DAOMethod(sql = " from MedicationDecoction where hospitalCode =:hospitalCode and decoctionCode =:decoctionCode")
    public abstract MedicationDecoction getMedicationDecoctionByDecoctionCode(@DAOParam("decoctionCode") String decoctionCode,@DAOParam("hospitalCode") String hospitalCode);

    @DAOMethod(sql = " from MedicationDecoction where hospitalCode =:hospitalCode and dicItemId =:dicItemId")
    public abstract MedicationDecoction getMedicationDecoctionByDicItemId(@DAOParam("dicItemId") Integer dicItemId,@DAOParam("hospitalCode") String hospitalCode);



}
